AddTESample
TheAddTESample
function allows you to specify a TextEdit handle (which may contain multiple style runs) to be added to the specified media.
pascal ComponentResult AddTESample (MediaHandler mh, TEHandle hTE, RGBColor *backColor, short textJustification, Rect *textBox, long displayFlags, TimeValue scrollDelay, short hiliteStart, short hiliteEnd, RGBColor *rgbHiliteColor, TimeValue duration, TimeValue *sampleTime);
mh
- Specifies the media handler for the text media obtained by the
GetMediaHandler
function.hTE
- A handle to a styled TextEdit structure.
backColor
- Contains a pointer to an RGB color structure specifying the text background color.
textJustification
- Indicates the justification of the text. The following constants are available:
teFlushDefault
,teCenter
,teFlushRight
, orteFlushLeft
. See Inside Macintosh: Text for details on these constants and on text alignment.textBox
- Contains a pointer to the box within which the text is to be displayed. The box is relative to the track bounds.
displayFlags
- Contains the text display flags.
dfDontDisplay
- Does not display the specified sample.
dfDontAutoScale
Does not scale the text if the track bounds increase.dfClipToTextBox
- Clips to the text box only. (This is useful if the text overlays the video.)
dfShrinkTextBoxToFit
Recalculates size of thetextBox
parameter to just fit the given text and stores this rectangle with the text data.dfScrollIn
Scrolls the text in until the last of the text is in view.dfScrollOut
- Scrolls text out until the last of the text is out of view. If both
dfScrollIn
anddfScrollOut
are set, the text is scrolled in, then out.dfHorizScroll
- Scrolls a single line of text horizontally. If the
dfHorizScroll
flag is not set, then the scrolling is vertical.dfReverseScroll
- If set, scrolls vertically down, rather than up. If not set, horizontal scrolling proceeds toward the left rather than toward the right.
scrollDelay
Indicates the delay in scrolling associated with the setting of thedfScrollIn
anddfScrollOut
display flags. If the value of thescrollDelay
parameter is greater than 0 and thedfScrollIn
flag is set, the text pauses when it has scrolled all the way in for the amount of time specified byscrollDelay
. If thedfScrollOut
flag is set, the pause occurs first before the text scrolls out. If both these flags are set, the pause occurs at the midpoint between scrolling in and scrolling out.hiliteStart
Specifies the beginning of the text to be highlighted.hiliteEnd
- Specifies the end of the text to be highlighted. If the
hiliteEnd
parameter is greater than thehiliteStart
parameter, then the text is highlighted from the selection specified byhiliteStart
tohiliteEnd
. To specify additional highlighting, you can use theAddHiliteSample
function, described in the next section.rgbHiliteColor
- Contains a pointer to the RGB color for highlighting. If this parameter is not
nil
, then the specified color is used when highlighting the text indicated by thehiliteStart
andhiliteEnd
parameters. Otherwise, the default system highlight color is used.duration
- Specifies how long the text sample should last. This duration is expressed in the media's time base.
sampleTime
Contains a pointer to aTimeValue
structure. The actual media time at which the sample was added is returned here.ERROR CODES
File Manager errors
invalidMedia -2008 This media is corrupted or invalid
Memory Manager errors